<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>垂直水平居中</title>
    <style>
        .c {
            width: 500px;
            height: 500px;
            margin: 0 auto;
            background: #f40;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .a {
            background: #fff;
        }

        .clearfix::before,.clearfix::after {
            content: '.';
            display: block;
            height: 0;
            line-height: 0;
            visibility: hidden;
            clear: both;
        }
    </style>
</head>
<body>
    <div class="c">
        <div class="a">
            5456412131312354564121313123
        </div>
    </div>


</body>
</html>